package com.rankeiot.platform.domain;

import java.io.Serializable;
import java.sql.Types;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.sagacity.sqltoy.config.annotation.Entity;
import org.sagacity.sqltoy.config.annotation.Id;
import org.sagacity.sqltoy.config.annotation.Column;


@Data
@NoArgsConstructor
@Schema(description = "角色管理")
@Entity(tableName="t_role")
public class Role implements Serializable{
    public Role(String sn){
        this.sn=sn;
    }

    /**
    * 编码
    */
    @Schema(description = "编码")
    @Id
    @Length(max=20)
    @Column(name="sn",length=20L,type=Types.VARCHAR,nullable=false)
    private String sn;
    /**
    * 角色名
    */
    @Schema(description = "角色名")
    @Length(max=20)
    @NotNull
    @Column(name="name",length=20L,type=Types.VARCHAR)
    private String name;
    /**
    * 角色类型
    */
    @Schema(description = "角色类型")
    @Length(max=20)
    @Column(name="role_type",length=20L,type=Types.VARCHAR)
    private String roleType;

    /**
     * 权限范围
     */
    @Schema(description = "权限范围")
    @Length(max=20)
    @Column(name="scope",length=10L,type=Types.VARCHAR)
    private String scope;
}
